<% include ../common/header.ejs %>
</head>
<body>
    <% include ../common/nav.ejs %>
    <div class="container">
        <div class="row">
            <% include ../common/sidebar.ejs %>
            <div class="col-md-10">
                <ol class="breadcrumb">
                    <li><a href="#">主页</a></li>
                    <li><a href="#">文章管理</a></li>
                    <li class="active">文章添加</li>
                </ol>
                
                <form class="form-horizontal" action="/admin/article/add" method="post">
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">标题</label>
                        <div class="col-sm-10">
                        <input type="text" name="title" class="form-control" id="inputEmail3" placeholder="标题">
                        </div>
                    </div>
                    <div class="form-group">
                            <label for="inputEmail3" class="col-sm-2 control-label">作者</label>
                            <div class="col-sm-10">
                            <input type="text" name="author" class="form-control" id="inputEmail3" placeholder="作者">
                            </div>
                        </div>
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">简介</label>
                        <div class="col-sm-10">
                            <textarea name="brife" class="form-control" cols="30" rows="10"></textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputPassword3" class="col-sm-2 control-label">栏目</label>
                        <div class="col-sm-10">
                            <select name="cid" id="" class="form-control">
                                <%for(var i=0;i<categories.length;i++){%>
                                <option <%if(cid==categories[i].cid){%> selected <%}%>  value="<%=categories[i].cid %>"><%=categories[i].cname%></option>
                                <%}%>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="dtp_input1" class="col-sm-2 control-label">发布时间</label>
                        <div class="input-group date form_datetime col-sm-5" data-date="2019-12-01T05:25:07Z" data-date-format="dd MM yyyy - HH:ii p" data-link-field="dtp_input1">
                            <input class="form-control" size="16" type="text" value="" readonly>
                            <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                            <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
                        </div>
                        <input type="text" id="dtp_input1" name="time"  value="" /><br/>
                    </div>
                    <div class="form-group">
                        <label for="inputPassword3" class="col-sm-2 control-label">内容</label>
                        <div class="col-sm-10">
                            <!-- <textarea class="form-control" name="" id="" cols="30" rows="10"></textarea> -->
                            <script id="editor" name="content" type="text/plain" style="width:100%;height:500px;"></script>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-default">保存</button>
                        </div>
                    </div>
                </form>
            </div>
            
        </div>
    </div>

<% include ../common/footer.ejs %>
<script type="text/javascript" src="/datetimepicker/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="/datetimepicker/js/locales/bootstrap-datetimepicker.fr.js" charset="UTF-8"></script>
<script type="text/javascript">
    $('.form_datetime').datetimepicker({
        //language:  'fr',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		forceParse: 0,
        showMeridian: 1
    });
	
</script>